home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / source.exe / POSIX / LD / MAIN.C < prev    next >
C/C++ Source or Header  |  1992-07-10  |  1KB  |  71 lines

  1. #include <sys/types.h>
  2. #include <fcntl.h>
  3. #include <errno.h>
  4. #include <unistd.h>
  5. #include <stdio.h>
  6. #include <ctype.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9.  
  10. char *usage = "usage: ld: [-eg] [-f file] [options]";
  11. /*
  12.     only question here is:
  13.         how many extra arguments do we add for microsoft
  14.             link parameters not given in unix
  15.         how do we map non-mappable unix parameters
  16. */
  17.  
  18. main(argc, argv) 
  19.     int argc;
  20.     char **argv;
  21. {
  22.     int ch;
  23.     extern
  24.         opterr,
  25.         optind;
  26.     extern char
  27.         *optarg;
  28.     register
  29.         i;
  30.  
  31.     opterr = 0;
  32.     fprintf (stderr, "link\n");
  33.     for (i = 1; i < argc; i++)
  34.         if (argv [i] [0] != '-')
  35.             fprintf (stderr, "%s\n", argv [i]);
  36.     while ((ch = getopt(argc, argv, "o:s:u:v:")) != EOF)
  37.     {
  38.         switch(ch) {
  39.         /*
  40.             output file
  41.         */
  42.         case 'o':        
  43.             fprintf (stderr, "/OUT:%s\n", optarg);
  44.             break;
  45.         /*
  46.             stack size
  47.         */
  48.         case 's':        
  49.             fprintf (stderr, "/STACK:%s\n", optarg);
  50.             break;
  51.         /*
  52.             subsystem
  53.         */
  54.         case 'u':        
  55.             fprintf (stderr, "/SUBSYSTEM:%s\n", optarg);
  56.             break;
  57.         /*
  58.             output file
  59.         */
  60.         case 'v':        
  61.             fprintf (stderr, "/VERSION:%s\n", optarg);
  62.             break;
  63.         case '?':
  64.         default:
  65.             fprintf (stderr, "/%c\n", ch);
  66.             break;
  67.         }
  68.     }
  69.     exit(0);
  70. }
  71.